import requests
import base64
import json
import time

header = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36 OPR/54.0.2952.64",
    "Referer": "http://v.ahtv.cn/"
}
# req = requests.get(
#    "http://v.ahtv.cn/m2o/m3u8.php?url=http://live.ahtv.cn/live/jjsh.m3u8", headers = header)

key_url = "https://tv-api.bshltv.com/index/index?a=LVS2dc6Beezq2tCgv7VdxnU2lbZ78OkQ1Ea1MaEOmx3pS1G0LL5D39GyL9kgB%2B4FwJJqsMFJzUJAG%2BBWmicQJofpBtJcuUOGJj%2Fqzcm0Z7Iy5VQWHBNrR7jhRFsPUTboiPHDPz81BvXyM%2FW7hHcZgB1DRY%2BzRVqLYYJ1V7Hu27VOzxhlfD8Bfj%2Bkr4UVhwXUI5DTOkGj8sqBe7pRKSZKYfpZGD26Mn4tf053SrQpJqWPdji5st6oadraHZcK4zJDdYYhvMh3j3OyOlRJze1Pfjr%2FumWYcpeCbUrrPyExadSc0GYQ63jFWEz9RkmP5qIllY5x1P575AjgeC7k%2FuZ427Dqe9hKFiotuLXwgnLzRzTAqLOMuD2Skaf6ZOnn%2Baeu4VCtGU095WRvwwvYAO7LtQ%3D%3D"
# verify=False不校验证书
# resp = requests.get(key_url, verify=False)

#test_url = "http://api.app.kankanews.com/kankan/v5/livePC/stream/live/?id=800084"
test_url = "https://channel.gztv.com/channelf/viewapi/player/channelVideo?id=5c7f7097e4b01c17db18fbd7&commentFrontUrl=https://comment.gztv.com/commentf"
header2 = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36 OPR/54.0.2952.64",
    #"Referer": "http://player.kksmg.com/data/player_swf/KKPlayer.swf",
    #"Cookie": "UM_distinctid=1692e3e6cff1f4-08ced45eede9ed-293e1d4e-1fa400-1692e3e6d002c1;"
}

voice_url = "http://semantics-test.bshltv.com/uploads/2019-06/28/bsw.json"
resp = requests.get(voice_url)
print(time.time())
obj = json.loads(resp.text)
print(time.time())
arr = obj["rasa_nlu_data"]["common_examples"]
print(time.time())
